package models

import (
	"github.com/goravel/framework/database/orm"
)

type TradeLog struct {
	orm.Model
	ActionTime      string         `gorm:"column:action_time;type:datetime(3);not null" form:"action_time" json:"action_time"`
	UserName        string         `gorm:"column:user_name;type:varchar(255);not null" form:"user_name" json:"user_name"`
	StreamId        string         `gorm:"column:stream_id;type:varchar(255);not null" form:"stream_id" json:"stream_id"`
	TradeType       string         `gorm:"column:trade_type;type:varchar(255);not null" form:"trade_type" json:"trade_type"`
	TradeStep       string         `gorm:"column:trade_step;type:varchar(255);" form:"trade_step" json:"trade_step"`
	ItemTxt         string         `gorm:"column:item_txt;type:varchar(255);not null" form:"item_txt" json:"item_txt"`
	Price           string         `gorm:"column:price;type:varchar(255); null" form:"price" json:"price"`
	Cash            string         `gorm:"column:cash;type:varchar(255); null" comment:"现金" form:"cash" json:"cash"`
	Merchant        string         `gorm:"column:merchant;type:varchar(255); null" form:"merchant" json:"merchant"`
	OnlineNum       string         `gorm:"column:online_num;type:varchar(255); null" form:"online_num" json:"online_num"`
	Balance         string         `gorm:"column:balance;type:varchar(255); null" comment:"账户余额" form:"balance" json:"balance"`
	Gold            string         `gorm:"column:gold;type:varchar(255); null" comment:"黄金" form:"gold" json:"gold"`
	OriginalText    string         `gorm:"column:original_text;type:text;not null;comment:'原文'" json:"original_text"`
	ConfigurationID int            `gorm:"column:configuration_id;type:int;null" form:"configuration_id" json:"configuration_id"`
	Configuration   *Configuration `gorm:"foreignkey:ConfigurationID" form:"-" json:"-"`
}

// TableName sets the insert table name for this struct type
func (t *TradeLog) TableName() string {
	return "tradelogs"
}
